-- This file can be loaded by calling `lua require('plugins')` from your init.vim

-- Only required if you have packer configured as `opt`
vim.cmd [[packadd packer.nvim]]

return require('packer').startup(function()

    -- Packer can manage itself
    use 'wbthomason/packer.nvim'

    -- 使用gruvbox主题
    use {"ellisonleao/gruvbox.nvim", requires = {"rktjmp/lush.nvim"}}
    -- nvim-tree插件
    use {
    'kyazdani42/nvim-tree.lua',
    requires = {
      'kyazdani42/nvim-web-devicons', -- optional, for file icon
        },
    config = function() require'nvim-tree'.setup {} end
    }

    use {'kevinhwang91/rnvimr'}
    -- bufferline插件
    -- using packer.nvim
    use {'akinsho/bufferline.nvim', requires = 'kyazdani42/nvim-web-devicons'}
    
    -- indent-blankline插件
    
    use {'lukas-reineke/indent-blankline.nvim'}


    -- autopair插件
    use {
    'windwp/nvim-autopairs'
    }
    
    -- statusline插件
    use {
    'nvim-lualine/lualine.nvim',
    requires = {'kyazdani42/nvim-web-devicons', opt = true}
    }

     -- LSP插件
     use {
        'neovim/nvim-lspconfig',
        'williamboman/nvim-lsp-installer', 
    }
    
    use {'mfussenegger/nvim-jdtls'}
    --use {'neoclide/coc.nvim', branch = 'release'}

     -- 文件搜索 预览 等
    use {
    
        'nvim-telescope/telescope.nvim',
        requires = {'nvim-lua/plenary.nvim','kyazdani42/nvim-web-devicons'}
    }
    -- 加速文件搜索速度,如果安装失败需要到插件目录执行make命令手动编译
    -- 用了这个插件以后，貌似更快了(感觉输入更跟手了，可能是心理作用)。但是对于我的小项目感受不是很明显
    use {
        'nvim-telescope/telescope-fzf-native.nvim', run = "make"}

    -- autocomplete插件
    use { 
        'hrsh7th/nvim-cmp',
        requires = { 'L3MON4D3/LuaSnip', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path',
        'hrsh7th/cmp-buffer',
        'saadparwaiz1/cmp_luasnip',
        }

    }
    
    -- nvim-treesitter插件
    use {
        'nvim-treesitter/nvim-treesitter',
        run = ':TSUpdate'
    }

    use {'glepnir/lspsaga.nvim'}


    use {'kdheepak/lazygit.nvim'}
    use {'thazelart/figban.nvim'}

    use {'iamcco/markdown-preview.nvim',
        run=[[sh -c 'cd app && yarn install']]
    }

    use {'dhruvasagar/vim-table-mode'}

    use {'ferrine/md-img-paste.vim'}

end)
